// #ifdef H5
import popup from '../popup/popup'
// #endif
const install = (app) => {
    app.config.globalProperties.$popup = {
        show(params) {
            // #ifdef APP-PLUS
            uni.navigateTo({
                url: '/uni_modules/vk-confirm/components/vk-confirm/vk-confirm?params=' + JSON.stringify(params),
                events: {
                    confirm: function (data) {
                        params.confirm && params.confirm()
                    },
                    cancel: function (data) {
                        params.cancel && params.cancel()
                    }
                }
            })
            // #endif

            // #ifdef H5
            popup(params)
            // #endif
        }
    }
}

export default install;
